﻿<%@ Control Language="C#" AutoEventWireup="true" CodeFile="e_products.ascx.cs" Inherits="administrator_uc_admin_e_products" %>
<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="asp" %>
<%@ Register Assembly="CKEditor.NET" Namespace="CKEditor.NET" TagPrefix="CKEditor" %>
<script src="../js/jquery.MultiFile.js" type="text/javascript"></script>
<script type="text/javascript">
    /* Optional: Temporarily hide the "tabber" class so it does not "flash"
    on the page as plain HTML. After tabber runs, the class is changed
    to "tabberlive" and it will appear. */
    //document.write('<style type="text/css">.tabber{display:none;}<\/style>');
    function checkUncheck(chk) {
        if (chk.checked) {
            $("#ShowOrHideFileUploadImage").show();
        } else {
            $("#ShowOrHideFileUploadImage").hide();
        }
    }
    function checkUncheckSPKhuyenMai() {
        var checkbox1 = $("#<%= chkSPKhuyenMai.ClientID %>");
        var domCheckbox1 = checkbox1[0];
        var isChecked = domCheckbox1.checked;
        if (isChecked) {
            $("#<%= txtKhuyenMaiInfo.ClientID %>").removeAttr("disabled");
            var mytext = document.getElementById("<%= txtKhuyenMaiInfo.ClientID %>");
            mytext.focus();
        }
        else {
            $("#<%= txtKhuyenMaiInfo.ClientID %>").attr("disabled", "disabled");
        }
    }   
</script>
<script>
    $(document).ready(function () {
        $("#ShowOrHideFileUploadImage").hide();
        var checkbox1 = $("#<%= chkSPKhuyenMai.ClientID %>");
        var domCheckbox1 = checkbox1[0];
        var isChecked = domCheckbox1.checked;
        if (isChecked) {
            $("#<%= txtKhuyenMaiInfo.ClientID %>").removeAttr("disabled");
        }
        else {
            $("#<%= txtKhuyenMaiInfo.ClientID %>").attr("disabled", "disabled");
        }
    });
</script>
<%--<div class="classtitle">THÊM MỚI</div>--%>
<div class="classmessage">  
    <asp:Label ID="lblMessage" runat="server"></asp:Label>  
    <asp:HiddenField ID="hdItemID" runat="server" />
</div>
<asp:UpdatePanel ID="upPanelAdmin" runat="server" UpdateMode="Conditional">
<ContentTemplate> 
    <asp:TabContainer ID="MyTabContainer" runat="server">
        <asp:TabPanel ID="TabPanel1" runat="server" HeaderText="Thông tin chung">
        <ContentTemplate>
            <p class="clsnotices">Thông tin bắt buộc<span class="requitevalue">(*)</span></p>  	   
            <table cellspacing="1" class="classtable">  
                <tr>
                    <td class="classcolleft">
                        Mã sản phẩm:</td>
                    <td class="classcolright">
                        <asp:TextBox ID="txtProductID" runat="server" Width="150px" Enabled="false"></asp:TextBox>
                    </td>
                </tr>
                <tr>
                    <td class="classcolleft">
                        Thuộc nhóm sản phẩm:</td>
                    <td class="classcolright">
                        <asp:DropDownList ID="DropdownParentID" runat="server" Width="250px" AppendDataBoundItems="true">
                            <asp:ListItem Value="0">---Chọn nhóm sản phẩm---</asp:ListItem>
                        </asp:DropDownList><span class="requitevalue">(*)</span>
                    </td>
                </tr>            
                <tr>
                    <td class="classcolleft">
                        Tên sản phẩm:</td>
                    <td class="classcolright">
                        <asp:TextBox ID="txtProductName" runat="server" Width="300px"></asp:TextBox><span class="requitevalue">(*)</span>
                        <asp:RequiredFieldValidator ID="RequiredFieldValidatorTitle" runat="server" 
                            ControlToValidate="txtProductName" ErrorMessage="Chưa nhập tên sản phẩm"></asp:RequiredFieldValidator>
                    </td>
                </tr>   
                <tr>
                    <td class="classcolleft">
                    Mô tả:</td>
                    <td class="classcolright">
                        <asp:TextBox ID="txtDescription" runat="server" Height="60px" 
                            TextMode="MultiLine" Width="600px"></asp:TextBox>
                    </td>
                </tr>   
                <tr>
                <td class="classcolleft">
                        Nội dung:</td>
                    <td class="classcolright">
                        <CKEditor:CKEditorControl ID="CKEditorBody" runat="server" Toolbar="Full" Height="220px"></CKEditor:CKEditorControl>
                        </td>
                </tr>   
                <tr>
                    <td class="classcolleft">
                        Hiển thị:</td>
                    <td class="classcolright">
                        <asp:RadioButtonList ID="rdActive" runat="server" 
                            RepeatDirection="Horizontal">
                            <asp:ListItem Selected="True" Value="1">Có</asp:ListItem>
                            <asp:ListItem Value="0">Không</asp:ListItem>
                        </asp:RadioButtonList>
                    </td>
                </tr>            
            </table>   
        </ContentTemplate>
        </asp:TabPanel>
        <asp:TabPanel ID="TabPanel2" runat="server" HeaderText="Thông tin liên quan">
        <ContentTemplate>
            <p class="clsnotices">Thông tin bắt buộc<span class="requitevalue">(*)</span></p>   
            <table cellspacing="1" class="classtable">             
                <%--<tr>
                    <td class="classcolleft">
                        Nhà sản xuất:</td>
                    <td class="classcolright">
                        <asp:DropDownList ID="DropDownBrands" runat="server" Width="250px" AppendDataBoundItems="true">
                            <asp:ListItem Value="0">---Không chọn---</asp:ListItem>
                        </asp:DropDownList>
                    </td>
                </tr> --%>
                <tr>
                <label id="lblMessageContent" class="clsmessage"></label>
                    <td class="classcolleft">
                    Ảnh đại diện:
                    </td>
                    <td class="classcolright">
                        <asp:Literal ID="ltViewImage" runat="server"></asp:Literal>
                    </td>
                </tr>            
                <tr>
                    <td class="classcolleft">
                    </td>
                    <td class="classcolright">
                        <div>
                            <input id="chkUploadFileNew" type="checkbox"
                                onchange="javascript:checkUncheck(this);" /><label for="chkUploadFileNew">Cập nhật ảnh đại diện mới</label></div>
                        <div id="ShowOrHideFileUploadImage"><asp:FileUpload ID="FileUploadImageDaiDien" runat="server" Width="300px" /></div>             
                    </td>
                </tr>            
                <tr>
                    <td class="classcolleft">
                    Giá mới:
                    </td>
                    <td class="classcolright">   
                        <asp:TextBox ID="txtNewPrice" runat="server"  CssClass="clsprice"></asp:TextBox><span class="clsunitprice">vnđ</span>     
                        <asp:RangeValidator ID="RangeValidator1" runat="server" 
                    ControlToValidate="txtNewPrice" ErrorMessage="(0-&gt;999999999)" 
                    MaximumValue="999999999" MinimumValue="0" Type="Integer"></asp:RangeValidator>         
                    </td>
                </tr>
                <tr>
                    <td class="classcolleft">
                    Giá cũ:
                    </td>
                    <td class="classcolright">   
                        <asp:TextBox ID="txtOldPrice" runat="server"  CssClass="clsprice"></asp:TextBox><span class="clsunitprice">vnđ</span>                
                        <asp:RangeValidator ID="RangeValidator2" runat="server" 
                            ControlToValidate="txtOldPrice" ErrorMessage="(0-&gt;999999999)" 
                            MaximumValue="999999999" MinimumValue="0" Type="Integer"></asp:RangeValidator>
                    </td>
                </tr>
                <tr>
                    <td class="classcolleft">              
                    </td>
                    <td class="classcolright">   
                    <asp:CheckBox ID="chkIsNew" runat="server" Text="New" />
                     <asp:CheckBox ID="chkSPBanChay" runat="server" Text="Hot" />
                     <asp:CheckBox ID="chkStatus" runat="server" Text="Stocking" Checked="true" />
                     <asp:CheckBox ID="chkSPKhuyenMai" runat="server" onclick="javascript:checkUncheckSPKhuyenMai();" Text="Sale" />

                     <%----Số lần xem:<asp:TextBox ID="txtCountView" runat="server"  CssClass="clscountviews"></asp:TextBox>--%>
                     <%--<asp:RangeValidator ID="RangeValidator3" runat="server" 
                            ControlToValidate="txtCountView" ErrorMessage="(Nhập vào kiểu số)" 
                            MaximumValue="999999999" MinimumValue="0" Type="Integer"></asp:RangeValidator>--%>

                    </td>
                </tr> 
                <%--<tr>
                    <td class="classcolleft">
                    Thông tin bảo hành:
                    </td>
                    <td class="classcolright">   
                        <asp:TextBox ID="txtBaoHanh" runat="server" TextMode="MultiLine" Width="600px"></asp:TextBox>
                    </td>
                </tr>--%>
                <tr>
                    <td class="classcolleft">
                     Thông tin khuyến mại:
                    </td>
                    <td class="classcolright">
                        <asp:TextBox ID="txtKhuyenMaiInfo" runat="server" Height="60px" 
                            TextMode="MultiLine" Width="600px"></asp:TextBox>
                    </td>
                </tr>    
                <tr>
                    <td class="classcolleft">
                    Ảnh liên quan:
                       </td>
                    <td class="classcolright">              
                    <div id = "divContentListImage"> 
                        <asp:Literal ID="ltListImages" runat="server"></asp:Literal>            
                    </div>                
                    </td>
                </tr>    
                <tr>
                    <td class="classcolleft">                 
                    </td>
                    <td class="classcolright"> 
                    <span class="requitevalue">Cho phép upload <=10 ảnh. Chấp nhận các định dạng: gif|jpg|png|bmp</span>                   
                    </td>
                </tr>          
                <tr>
                    <td class="classcolleft">
                    Thêm ảnh liên quan:
                       </td>
                    <td class="classcolright">
                    <div>
                        <asp:FileUpload ID="FileUploadImageRelated" runat="server" CssClass="multi" 
                            Width="300px" maxlength="10" accept="gif|jpg|png|bmp" />
                    </div>            
                    </td>
                </tr>                   
            </table> 
        </ContentTemplate>
        </asp:TabPanel>
    </asp:TabContainer>
    <table cellspacing="1" class="classtable">  
     <tr>
        <td class="classcolleft">
            &nbsp;</td>
        <td class="classcolright">
            <asp:LinkButton ID="lbtEditItem" runat="server" onclick="lbtEditItem_Click">
            <img src="../images/icons/icon_edit.png" border="0px" /> <b>Cập Nhật</b>
            </asp:LinkButton>
            ||
            <asp:LinkButton ID="lbtCloseForm" runat="server" 
                OnClientClick="javascript:CloseWindows();" CausesValidation="False">
            <img src="../images/icons/icon_close.jpg" border="0px" /><b>Đóng Lại</b>
            </asp:LinkButton>
         </td>
    </tr>
    </table>
</ContentTemplate>
<Triggers>
    <asp:PostBackTrigger ControlID="lbtEditItem" />
</Triggers>      
</asp:UpdatePanel> 
